import {validatorEnum} from "./validatorEnum";
import {buildValidator} from "./buildValidator";
import {requireValidator} from "./requireValidator";
import {abstractValidator} from "./abstractValidator";
import {maxLengthValidator} from "./maxLengthValidator";
import {minLengthValidator} from "./minLengthValidator";
import {maxAndMinLengthValidator} from "./maxAndMinLengthValidator";
import {regularFailValidator} from "./regularFailValidator";
import {mc_validatorResult} from "../model/mc_validatorResult";
import {equalProperyValidator} from "./equalProperyValidator";

/**
 * Created by ybjaa on 2017/6/28.
 */
export class validatorManage{

    static GetValidatorClasses(enumType:validatorEnum){

        let validator:abstractValidator=null;

        switch(enumType){


            case validatorEnum.require:
                validator=new requireValidator();
                break;

            case validatorEnum.maxLength:
                validator=new maxLengthValidator();
                break;

            case validatorEnum.minLength:
                validator=new minLengthValidator();
                break;

            case validatorEnum.maxAndMinLength:
                validator=new maxAndMinLengthValidator();
                break;

            case validatorEnum.regularFail:
                validator=new regularFailValidator();
                break;

            case validatorEnum.equalPropery:
                validator=new equalProperyValidator();
                break;

            default:break;
        }

        return validator;
    }

}